package cn.com.huzo.repository.purchase.impl;

import cn.com.huzo.model.entities.purchase.PoLinesSurchargesEntity;
import huzofw.repository.impl.GenericRepositoryImpl;
import huzofw.repository.impl.MyBatisDaoUtils;
import java.util.List;
import org.springframework.stereotype.Repository;
import cn.com.huzo.repository.purchase.PoLinesSurchargesRepository;

/**
 * 附加费数据访问对象。
 *
 * @author 吴旭
 */
@Repository("PoLinesSurchargesRepository")
public class PoLinesSurchargesRepositoryImpl extends GenericRepositoryImpl<PoLinesSurchargesEntity, String>
        implements PoLinesSurchargesRepository {

    private final String namespace = "cn.com.huzo.repository.purchase.PoLinesSurchargesRepository";

    /**
     * 构造函数,设置the entity to MpcLinesSurchargesRepositoryImpl.class.
     */
    public PoLinesSurchargesRepositoryImpl() {
        super(PoLinesSurchargesEntity.class);
    }

    /**
     * {@inheritDoc}
     */
    @Override
    public List<PoLinesSurchargesEntity> fetchAllByHeaderKey(Long headerKey) {
        return getSqlSession().selectList(MyBatisDaoUtils.getMapperQueryId(
                namespace, "fetchAll"), headerKey);
    }

    /**
     * {@inheritDoc}
     */
    @Override
    public Integer batchInsert(List<PoLinesSurchargesEntity> itemList) {
        return getSqlSession().insert(MyBatisDaoUtils.getMapperQueryId(
                namespace, "insert"), itemList);
    }

    /**
     * {@inheritDoc}
     */
    @Override
    public Integer batchUpdate(List<PoLinesSurchargesEntity> itemList) {
        return getSqlSession().update(MyBatisDaoUtils.getMapperQueryId(
                namespace, "update"), itemList);
    }

    /**
     * {@inheritDoc}
     */
    @Override
    public Integer delete(String linesKeyd) {
        return getSqlSession().delete(MyBatisDaoUtils.getMapperQueryId(
                namespace, "delete"), linesKeyd);
    }
}
